package worldinruin.controllers;





import java.util.HashMap;
import java.util.Map;

import javax.swing.Action;

// Control Factory from the GAPP project

public class ControlFactory {
	
	public enum Controllers {
		GAME_CONTROLLER,
		GAMEBOARD_CONTROLLER,
		BATTLE_CONTROLLER,
		PANEL_CONTROLLER
		
	}
	
	private final static Map<Controllers, Action> controllers = new HashMap<Controllers, Action>();
	static {		
		controllers.put(Controllers.GAME_CONTROLLER, new GameController());	
		controllers.put(Controllers.GAMEBOARD_CONTROLLER, new GameBoardController());
	}
	
	/**
	 * Gets controllers in used for the game.
	 * @param ctrl Specify controller.
	 * @return Controller.
	 */
	public static Action getControl(Controllers ctrl) {
		if( ctrl == null ){
			throw new IllegalArgumentException("Control null");
		}
		return controllers.get(ctrl);
	}

}
